import * as React from 'react';
import {BottomNavigation} from 'react-native-paper';
import Home from "../pages/Home";
import User from "../pages/User";
import HomeScreen from "../pages/HomeScreen";

const App = () => {
    const [index, setIndex] = React.useState(0);
    const [routes] = React.useState([
        {key: 'Home', title: 'Home', icon: 'camera'},
        {key: 'User', title: 'User', icon: 'album'},
        {key: 'HomeScreen', title: 'HomeScreen', icon: 'history'},
    ]);
    const renderScene = BottomNavigation.SceneMap({
        Home,
        User,
        HomeScreen,
    });
    // const renderScene = ({ route, jumpTo }) => {
    //     switch (route.key) {
    //         case 'Home':
    //             return <Home jumpTo={jumpTo} />;
    //         case 'User':
    //             return <User jumpTo={jumpTo} />;
    //     }
    // }
    return (
        <BottomNavigation
            navigationState={{index, routes}}
            onIndexChange={setIndex}
            renderScene={renderScene}
        />
    );
};

export default App;